#ifndef __FL_H__
#define __FL_H__

typedef struct _BLK_LINK_T
{
    VOIDX *pData;
    struct _BLK_LINK_T *Next;
} BLK_LINK_T,*PBLK_LINK_T;

typedef struct _FL_NODE_T
{
    VOIDX *pData;
    struct _FL_NODE_T *Next;
} FL_NODE_T,*PFL_NODE_T;

typedef struct _FL_ROOT_T
{
    ULONGX uSize;
    PFL_NODE_T pstFree;
    PFL_NODE_T pstUsed;
    PBLK_LINK_T pstBlkLink;
    BOOLX b_IsPaged;
    BOOLX (*Expand)(struct _FL_ROOT_T *);
    ULONGX uExpandNum;

    VOIDX * (*Get)(struct _FL_ROOT_T *);
    VOIDX (*Put)(struct _FL_ROOT_T *,VOIDX *);
    VOIDX (*Cleanup)(struct _FL_ROOT_T *);
} FL_ROOT_T,*PFL_ROOT_T;

PVOIDX FL_Get(PFL_ROOT_T v_pstThis);
BOOLX FL_Init(PFL_ROOT_T v_pstThis,ULONGX v_uSize,BOOLX b);
BOOLX FL_Expand(PFL_ROOT_T v_pstThis);
VOIDX FL_Put(PFL_ROOT_T v_pstThis,PVOIDX pData);
VOIDX FL_Cleanup(PFL_ROOT_T v_pstThis);

#endif /* __FL_H__ */

